import zrender from 'zrender/zrender'
import BezierCurve from 'zrender/graphic/shape/BezierCurve'

export default {
  mounted() {
    const zr = zrender.init(this.$refs.chart)
    const width = 1000
    const height = 600
    const shape = new BezierCurve({
      shape: {
        x1: width,
        y1: 0,
        x2 : width / 2,
        y2 : 0,
        cpx1 : width / 2,
        cpy1 : height
      }, 
      style: {
        stroke: 'green',
        lineWidth: 2,
        text: 'beziercurve'
      },
      draggable:true
    })
    zr.add(shape)
  },

  render(h) {
    return (
      <div class="page">
        <div ref="chart" style="width: 100%; height: 600px"></div>
      </div>
    )
  }
}
